package com.caine.resource.controller;

import com.caine.common.entity.R;
import org.springframework.context.annotation.Role;
import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: CaineZhu
 * @Description:
 * @Date: Created in 18:48 2021/1/7
 * @Modified By:
 */
@RestController
public class TestController {
    @RequestMapping("test")
    public R test() {
        return R.success(System.currentTimeMillis());
    }

    @Secured("SELECT")
    @RequestMapping("test1")
    public R test1() {
        return R.success("test1");
    }

    @Secured("xxxx")
    @RequestMapping("test2")
    public R test2() {
        return R.success("test2");
    }
}
